﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Polymorphism
{
    class Program
    {
        static void Main(string[] args)
        {
          //  ServerBase s = new ServerCreator().CreateServer("sql iuwfbh wureibgre ");
         //   s.ExecuteQuery("SELECT ORDERS");

            Human h1 = new Guf();
            Human h2 = new Rastaman();

            Array humanTypes = Enum.GetValues(typeof(HumanType));

            foreach (HumanType h in humanTypes)
            {
                Console.WriteLine(h + " says: ");
                Human human = CreateHuman(h);
                human.SayHello();
            }

            Console.ReadKey();
        }

        private static Human CreateHuman(HumanType humanType)
        {
            switch (humanType)
            {
                case HumanType.Guf:
                    return new Guf();
                case HumanType.Pohuist:
                    return new Pohuist();
                case HumanType.Rastaman:
                    return new Rastaman();
                default:
                    return new Human();
            }
        }
    }

    enum HumanType
    {
        Human,
        Guf,
        Pohuist,
        Rastaman
    }
}
